//
//  LGReportDetailCT02Cell.m
//  HeartDiseaseManage
//
//  Created by 1234 on 2023/6/8.
//

#import "LGReportDetailCT02Cell.h"
#import "LGHeartChartReportView.h"

@interface LGReportDetailCT02Cell()
/**   */
@property (nonatomic , strong)UIView *baseView;
/**   */
@property (nonatomic , strong)UIButton *titleBtn;
/**   */
@property (nonatomic , strong)LGHeartChartReportView *reportView;

@end

@implementation LGReportDetailCT02Cell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
        [self.contentView addSubview:self.baseView];
        [self.baseView addSubview:self.titleBtn];
        [self.baseView addSubview:self.reportView];
        [self.baseView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.contentView).offset(viewPix(8));
            make.bottom.equalTo(self.contentView).offset(-viewPix(8));
            make.left.equalTo(self.contentView).offset(viewPix(16));
            make.right.equalTo(self.contentView).offset(-viewPix(16));
            make.height.equalTo(@(350+viewPix(55)));
        }];
    }
    return  self;
}

-(void)setDataDic:(NSDictionary *)dataDic{
    _dataDic = dataDic;
    self.reportView.dataDic2 = dataDic;
}

-(UIView *)baseView{
    if(!_baseView){
        _baseView = [UIView shadowViewWithColor:@"#B3C5D9" offset:CGSizeMake(0, 2) opacity:0.1 radius:15];
        _baseView.backgroundColor = [UIColor whiteColor];
    }
    return _baseView;
}

-(UIButton *)titleBtn{
    if(!_titleBtn){
        _titleBtn = [UIButton buttonWithTitle:@"报告信息" titleFont:LGFontWeight(16, UIFontWeightMedium) textColor:@"#1F6CC6" imageName:@""];
        [_titleBtn setBackgroundImage:[UIImage imageNamed:@"就诊检查-蓝色"] forState:UIControlStateNormal];
        _titleBtn.frame = CGRectMake(0, viewPix(20), 112, 27);
        _titleBtn.userInteractionEnabled = NO;
    }
    return _titleBtn;
}

-(LGHeartChartReportView *)reportView{
    if(!_reportView){
        _reportView = [[LGHeartChartReportView alloc] initWithFrame:CGRectMake(0, viewPix(55), Screen_W-viewPix(32), 350)];
    }
    return _reportView;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
